package com.ty.tour;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableTransactionManagement // 启用事务管理器
@MapperScan(basePackages = "com.ty.tour.mapper") // 扫描mybaits mapper包路径
@ComponentScan(basePackages = {"com.ty.tour"}) // 扫描所有需要的包 包含一些自用的工具类包所在的路径
@EnableScheduling
@Configuration
@EnableCaching
@EnableSwagger2
//@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class TrainApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
		SpringApplication.run(TrainApplication.class, args);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(TrainApplication.class);
	}

}

